package com.v.air.app.common;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.widget.Toast;

import com.v.air.app.AppManager;
import com.v.air.app.R;

public class UIHelper {

	public static void toastMessage(Context context, String message) {
		Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
	}

	public static void toastMessage(Context context, int message) {
		Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
	}

	public static void toastMessage(Context context, String message, int time) {
		Toast.makeText(context, message, time).show();
	}

	public static void sendAppCrashReport(final Activity context,
			final String crashReport) {
		AlertDialog.Builder builder = new AlertDialog.Builder(context);
		builder.setIcon(android.R.drawable.ic_dialog_info);
		builder.setTitle(R.string.exception);
		builder.setMessage(R.string.exception);
		builder.setNegativeButton(R.string.yes,
				new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int which) {
						dialog.dismiss();
						AppManager.getAppManager().AppExit(context);
					}
				});
		builder.show();
	}

}
